DENICOMP SYSTEMS                                       Winsock RSHD/95
----------------------------------------------------------------------
Copyright 1995  Denicomp Systems
All Rights Reserved


INTRODUCTION

Winsock RSHD/95 (Remote Shell Daemon) is a service for Windows 95
that accepts requests for command execution and file transfers from
other hosts on the network via TCP/IP and executes them on the PC
running Winsock RSHD/95.  It runs under Microsoft Windows 95 only.

Winsock RSHD/95 is similar to the Unix server of the same name, but
provides some special functionality for the Windows environment,
such as:

 - Ability to send keystrokes to the command running under Windows 95
 - Support for the rcp command to allow copying to and from the PC
 - Security mechanism to allow/deny access for hosts and users
 - Capture of standard output/standard error output of Console and MS-DOS
   programs

Command requests can come from hosts running other operating systems
such as Unix or from other PC's running Windows 95, Windows NT, or
Windows 3.1 using the standard rsh utility that comes with your
TCP/IP package or Winsock RSH, also available from Denicomp Systems.

Files can be copied to the PC or from the PC running Winsock RSHD/95
using the standard TCP/IP rcp command.  This includes the rcp
command available with Unix or Windows NT or a PC-based rcp command
such as Winsock RCP, also available from Denicomp Systems.


REQUIREMENTS

Winsock RSHD/95 requires a Intel x86-based PC running Windows 95 and
a network.  The Windows 95 TCP/IP protocol must be installed and
configured.



WINSOCK RSHD/95 INSTALLATION

To install Winsock RSHD/95,  insert the Winsock RSHD/95 diskette
into your diskette drive.  Click on the Windows 95 Start button,
then choose Run from the menu.  Then type the name of your diskette
drive followed by "SETUP".  For example, if the diskette is in the
A: drive, type "A:SETUP".  Then press the Enter key.  (This can also
be done from an MS-DOS prompt from within Windows 95 if you prefer).

The Winsock RSHD/95 Installation window will then appear.  Verify
that the drive letter shown in the Install From field is correct.
If it is not, specify the proper drive.

Specify the directory in which you would like Winsock RSHD/95 to be
installed in the Destination field.  This will default to the
\WRSHD95 directory on the drive where Windows 95 is installed.  You
may change it if you wish.

By default, Winsock RSHD/95 installs as a Windows 95 service.  A
service is a program that starts automatically when Windows 95
starts.  It is transparent and does not require anyone to be logged
in to Windows 95.  If you do not want Winsock RSHD/95 to be
installed as a service, uncheck the Install as a Windows 95 Service
option .  Winsock RSHD/95 can then be run as a program from the
Start menu.

Press the Install button to begin the installation.  Press Cancel if
you wish to exit.  Files will be copied from the diskette onto your
hard drive.

If you chose to install RSHD/95 as a service, Winsock RSHD/95 will
be installed in Windows 95s list of services and it will be started
for you.  You do not need to reboot.

If you did not choose to install RSHD/95 as a service, a menu
selection for RSHD/95 will be created on your Start menu.  To run
RSHD/95, find and select RSHD/95 from the menu.

See the section on Controlling Winsock RSHD/95 for instructions on
how to manually start and stop the Winsock RSHD/95 service.



REMOVING WINSOCK RSHD/95

To remove Winsock RSHD/95,  insert the Winsock RSHD/95 diskette into
your diskette drive.  Click on the Windows 95 Start button, then
choose Run from the menu.  Then type the name of your diskette drive
followed by "SETUP".  For example, if the diskette is in the A:
drive, type "A:SETUP".  Then press the Enter key.  (This can also be
done from an MS-DOS prompt from within Windows 95 if you prefer).

The installation window will appear.  The Destination field should
show the directory in which you installed RSHD/95.  If this is not
correct or you have moved RSHD/95, correct this field.  Then click
on Uninstall.  RSHD/95 will then be stopped and removed from your
hard drive.


RUNNING WINSOCK RSHD/95 AS A SERVICE

Under Windows 95, a service is a program that starts automatically
when Windows 95 starts.  It does not require you to log in to
Windows 95 or select anything from the Start menu.  It runs
transparently.  There is no RSHD/95 window.  It does not appear in
the Windows 95 Task List.

For those familiar with Windows NT services, Windows 95 services are
much more rudimentary.  There is no generic service controller as
there is in Windows NT to allow you to start, stop, install, and
uninstall services.

To give you some control over RSHD/95 when it is running as a
service, a utility is included that provides some of the functions
of NTs service controller.  With it you can start, stop, and
perform other functions that affect RSHD/95.  This is explained
later in the Controlling Winsock RSHD/95 section.


RUNNING WINSOCK RSHD/95 AS A PROGRAM

You can optionally run Winsock RSHD/95 as a Windows 95 program
instead of a service.  This requires that somone log in to Windows
95 and select RSHD/95 from the Start menu.

To start Winsock RSHD/95 as a program, execute the following
command:

          wrshd95

If you are executing this command from the Windows 95 MS-DOS, you
should use the command:

          start wrshd95

If you do not use the start command, you will not have access to
that MS-DOS Prompt window until RSHD/95 is stopped.  Be sure that
you do not already have Winsock RSHD/95 running as a service.

After you start RSHD/95, you will not see any window display.  It
runs transparently; it will not even appear in the Windows 95 Task
List.  If you need to stop RSHD/95, see the section on Controlling
Winsock RSHD/95 for more details.


WINSOCK RSHD/95 CONFIGURATION

Winsock RSHD/95 will work properly using its default configuration.
You only need to configure Winsock RSHD/95 if you wish to change any
of the available options, enable security, or use the logging
capabilities.  By default, no security is enforced and no logging is
done

You configure Winsock RSHD/95 by using the Windows 95 Control Panel.
In the Control Panel, you should see an icon labeled RSHD.  Double-
click on that icon to configure Winsock RSHD/95.

Important Note:  After changing a Winsock RSHD/95 Configuration
option, you do not need to stop and restart Winsock RSHD/95.  It
will recognize the change, unless you disable the monitoring of the
registry (see below).


BASIC CONFIGURATION OPTIONS


Security File:                     (Default: None)

     Specify the full path name of the Security File used by Winsock
     RSHD/95 to enforce security (allow and deny users and hosts).
     The format of this file is explained in more detail later.  If
     you do not specify a Security File, all users and hosts will be
     granted access to execute commands and transfer files to and
     from your PC, unless you enable the option that requires remote
     user names to exist as Windows 95 users (see below).
     
     If you do specify a Security File and it does not exist, no
     users or hosts will be granted access.

     If you do not wish to enforce any security, do not specify a
     filename.
     

Must Remote Users be Valid Users on this System?  (Default: Unchecked)

     If this option is unchecked, user login names sent to Winsock
     RSHD/95 by rcp and rsh do not need to be valid users on this
     system.  Security is enforced soley through the Security File.
     
     If this option is checked, user login names from rcp and rsh
     must be valid users on the this system.  If the user is not
     valid, access will be denied.  This is the standard behavior of
     a rshd daemon.  However, if the rcp and rsh commands are being
     executed from another operating system such as Unix, the user
     login names may not be the same
     
     between systems.  If user logins are the same, you can then
     enable this option for security.  If they are different, you
     should not enable this option.

Message Log:                       (Default: None)

     Specify the full path name of a file where any messages from
     Winsock RSHD/95 should be stored.  The message file is
     optional.  You should only enable the message log when you are
     trying to find the source of a problem, since the message log
     can become quite large on an active system.
     
     This option is used in conjunction with the Message Level
     option.  If Message Level is set to a value greater than zero
     (0), Winsock RSHD/95 will output messages that provide
     information about its operation.  These messages are mostly
     useful for problem determination.
     
     The message file created is a text file that you can examine at
     any time using utilities such as TYPE or MORE, or editors such
     as Notepad.  You can clear the message log at any time by
     simply deleting it.
     
Message Level:                (Default: 0)

     Specifies the level of detail of the messages stored in the
     file specified in the Message Log option.  The default level is
     0, which will not write any messages to the message log file.
     Levels 1 through 4 will product increasing amounts of detail
     (level 1 provides the least detail, level 4 provides the most).

Request Log:                       (Default: None)

     This option allows you to log all requests (commands to be
     executed) in a file you specify.  Each time someone attempts to
     execute a command through Winsock RSHD/95, the date and time,
     the user name, the host name, and the command will be written
     to this file.

Deny Log:                     (Default: None)

     This option allows you to log all permission violations in a
     file you specify.  Each time someone is denied permission to
     execute a command through Winsock RSHD/95, the date and time,
     the user name, the host name, and the command will be written
     to this file.
     





Error Log:                         (Default: None)

     This option allows you to log all command execution errors in a
     file you specify.  Each time someone receives an error trying
     to execute a command through Winsock RSHD/95, the date and
     time, the user name, the host name, the command, and error
     message will be written to this file.  These are errors that
     occur after the user has been
     granted permission to execute the command.  For example, an
     error would be logged if a program was to be run that did not
     exist.
     

NOTE: Each of the log files may refer to the same file name if you
wish. They will not overwrite each other.  Each message is appended
to the end of the file.  You should be sure to periodically delete
the log file(s) because they can get large over time on an active
system.


ADVANCED CONFIGURATION OPTIONS

These configuration options are for advanced users and do not
normally require deviations from their default values.  Full
understanding of some of them require an understanding of TCP/IP and
Windows Sockets operation and programming.

Some options refer to TCP/IP option set on sockets used by Winsock
RSHD/95.  Sockets are connections over the network.  Winsock RSHD/95
uses three sockets:

     Listen:  Listens for connections.

     Connect:   Connection made to receive parameters from rsh or rcp

     Stderr:  Socket created to send error messages back to the remote host.


The advanced options are:


Attempt Redirection on Every Command:   (Default: Unchecked)

     When you execute a command through Winsock RSHD/95, it assumes
     that the command is a Windows program (not a Console or MS-DOS
     program) and that there
     
     is no redirection of standard output/standard error back to the
     remote system, unless you use the special "<[CON]>",
     "<[CON2]>", "<[DOS]>", or "<[DOS2]>" indicators in the rsh
     command.  (This is explained in more detail later.)
     
     If you mostly execute Windows 95 Console programs and/or MS-DOS
     programs via rsh through Winsock RSHD/95, you can check this
     option and Winsock RSHD/95 will assume that each command is a
     Console/MS-DOS program and attempt to send its standard
     output/standard error back to the remote system.  It treats
     every rsh request
     as if the "<[CON]>" option was specified.  You do not need to
     specify the "<[CON]>" indicator; it is assumed.
     
     If you check this option, you still may execute Windows
     programs via rsh and they will operate properly.  However,
     unless you specify the special "<[WIN]>" indicator for Windows
     programs in the rsh command, there are a few downsides:  First,
     there will be slightly more overhead when executing Windows
     programs because Winsock RSHD/95 will attempt to capture the
     standard output/standard error. Also, RSHD/95 will wait for the
     Windows program to complete before closing the connection.  Again,
     these downsides can be overcome by specifying the "<[WIN]>" indicator.
     
Default Window Type for Commands:  (Default: Normal)

     Specifies the default window type to be used when executing
     commands through Winsock RSHD/95 using the rsh command.  The
     default window type is used when the special window type
     indicators (<[NORMAL]>, <[MINIMIZE]>, <[MAXIMIZE]>, <[HIDE]>,
     etc.) are not specified in the rsh command.
     
     The options available are:
     
     Normal:        The window for the command will display at its normal size.
     
     Minimized:     The window for the command will be minimized without focus.
     
     Maximized:     The window for the command will be maximized.
     
     Hidden:        The window for the command will be hidden.
     
     There are a few points you must consider when selecting the
     default window type:
     
          - The Minimized or Hidden options are useful when the system
            running RSHD/95 is actively used and is not a standalone server.
            With the Normal or Maximized options, the person using the system
            will see a window appear each time a command is executed through rsh.
          - You cannot send keystrokes to commands that are minimized or
            hidden.  So if you select the Minimized or Hidden option, you must
            override it in the rsh command when you want to send keystrokes.
            That is, you will need to add the <[NORMAL]> option to the command.

          - Using the Hidden option can cause administrative problems.
            When a programs window is hidden, it does not appear in the Task
            List, so there is not an easy way to stop a hidden program or to
            tell if any are running.  There are utilities that allow you to see
            the hidden programs (such as the PView program that comes with
            Microsoft Visual C/C++).
     
Preserve Case in Multi-File Copies:     (Default: Unchecked)

     Specifies whether Winsock RSHD/95 should preserve the case of
     filenames when files are copied from this system by rcp using
     wildcards or recursive copies.  By default, when the remote
     system uses a wildcard or recursive copy to get files from this
     PC, Winsock RSHD/95 will convert all directory and filenames to
     lowercase letters before sending them to the remote system.
     
     Although the Windows 95 filesystem is not case sensitive (ABC
     and abc are the same file), it can store the case of the
     filename.  When copying files via rcp to operating systems that
     are case sensitive, such as Unix, it is usually most useful to
     convert all of the names to lowercase letters.
     
     If you do not wish to have all of the names converted to
     lowercase letters, check this option.  The rcp command will
     then create files in exactly the same case as the names appear
     in the directory under Windows 95.
     
     Note that this affects only wildcard and recursive copies.
     When copying individual files, the files will be created in the
     case you specify in the rcp command.

Disable Multithreading in RSHD/95:      (Default: Unchecked)

     Multithreading allows Winsock RSHD/95 to process multiple
     requests simultaneously.  When multithreading is disabled by
     checking this option, Winsock RSHD/95 will accept and complete
     only one request at a time.  Other requests received during
     this time will be queued and executed in the order in which
     they were received.   Normally,
     you will want multithreading enabled, but you can disable it,
     for example, to ensure that the system will not become bogged
     down with requests.
     
Disable Monitoring of Registry for Changes:  (Default: Unchecked)

     Normally, if you change a configuration option using the RSHD
     icon in the Control Panel and click on the OK button, it sends
     a signal to RSHD/95 to tell it to re-examine the setup options
     stored in the Registry and apply any changes.
     
     If this option is checked to disable the monitoring of the
     Registry, this signal will be ignored.  You must stop and start
     Winsock RSHD/95 manually (or reboot the system) for the
     Registry changes to take effect.
     
     You may want the Registry monitoring disabled for security
     purposes so that no Winsock RSHD/95 options are changed while
     the system is in operation.
     
     Note:  RSHD/95 does not actualy "monitor" the Registry for
     changes; it waits for a signal to come from the RSHD Control
     Panel applet and then re-reads the registry options.  Unlike
     Windows NT, Windows 95 does not have the ability to determine
     when Registry options have changed.  So if you use a program
     like REGEDIT to change RSHD/95 setup options, they will not
     take effect unless you stop and start RSHD/95.
     
Host IP Address (If Multi-Homed):  (Default: None)

     If your system is multi-homed (it has multiple network cards,
     each with its own IP address), you can specify which IP address
     RSHD/95 will use to listen for requests.  If you leave this
     empty, it will accept requests from any of the IP addresses
     associated with the system.  If you specify one of the
     addresses of one of the cards (in dotted-decimal format), it
     will only accept requests routed to that address.

RCP Block Size:                    (Default: 512)

     Specifies the number of bytes in a block of data that the
     Remote Copy (rcp) service of Winsock RSHD/95 processes at one
     time.  When files are copied to the PC, it reads from the
     network and writes to the disk in blocks of this size.  When
     files are copied from the PC, it reads from the disk and writes
     to the network in blocks of this size.  Note that this is an
     internal block size only; it does not change any TCP/IP
     parameters.
     
RCP Spoofing Prefix:               (Default: <blank>)

     Specifies the first characters of the rcp command send by the
     remote host that Winsock RSHD/95 should use when "spoofing" the
     RCP protocol.  With its roots in Unix, the rcp command actually
     internally executes an rsh command to start rcp on the remote
     host before transferring files.  Winsock RSHD/95 "spoofs" or
     looks for rcp commands executed through rsh by the remote host
     and services the RCP transfer.
     
     Winsock RSHD/95 always looks for the command prefixes of "rcp -
     " and "/usr/bin/rcp -".  Some rcp commands (especially those on
     non-Unix and non-Windows systems) may send other commands to
     initiate the RCP protocol.  If yours does, you should enter the
     command prefix (up to and including the first hyphen) here.
     For example, rcp on one VAX VMS implementation requires the prefix
     "set vms_rcp = 1 ; rcp -" as the spoofing prefix.

Listen Port:                       (Default: 514)

     Specifies the port number that Winsock RSHD/95 listens to for
     connections.  The standard port for the Remote Shell daemon is
     514.

Listen Backlog:                    (Default: 5)

     The number of requests that can be backlogged when Winsock
     RSHD/95 is listening for connections.  The minimum is 1; the
     maximum is usually 5.

Listen Shutdown:                   (Default: 2)

     Specifies how the "Listen" socket is to be shutdown before it
     is closed.  A value of zero (0) means that it is not shutdown.
     A value of 1 halts all receiving before shutting down.  A value
     of 2 halts all sending and receiving before shutting down.

Listen Linger:                (Default: -1)

     If this option is set to zero (0), the TCP/IP linger option
     will be turned off for the "Listen" socket.  If this option is
     set to a value greater than zero, the linger option will be
     turned on and the timeout value will be set to the value you
     assign this option.  If this option is set to -1 or does not
     appear in the configuration file, no linger options will be
     set; the default linger option will be in effect.

Listen KeepAlive:                  (Default: -1)

     If this option is set to zero (0), the TCP/IP keepalive option
     will be turned off for the "Listen" socket.  If this option is
     set to 1, the keepalive option will be turned on.  If this
     option is set to -1 or does not appear in the configuration
     file, no keepalive option will be set; the default keepalive
     option will be in effect.

Listen ReuseAddr:                  (Default: 1)

     If this option is set to zero (0), the TCP/IP reuseaddr option
     (Reuse Address) will be turned off for the "Listen" socket.  If
     this option is set to 1, the reuseaddr option will be turned
     on.  If this option is set to "-1" or does not appear in the
     configuration file, no reuseaddr option will be set; the
     default reuseaddr option will be in effect.

Connection Shutdown:               (Default: 2)

     Sets the shutdown option for the connection socket.  See the
     Listen Shutdown option for an explanation of the valid values.

Connection Linger:                 (Default: -1)

     Sets the linger option for the connection socket.  See the
     Listen Linger option for an explanation of the valid values.

Connection KeepAlive:              (Default: -1)

     Sets the keepalive option for the connection socket.  See the
     Listen KeepAlive option for an explanation of the valid values.

Connection ReuseAddr:              (Default: 1)

     Sets the reuseaddr option for the connection socket.  See the
     Listen ReuseAddr option for an explanation of the valid values.

Stderr Linger:                (Default: -1)

     Sets the linger option for the standard error socket.  See the
     Listen Linger option for an explanation of the valid values.

Stderr KeepAlive:                  (Default: -1)

     Sets the keepalive option for the standard error socket.  See
     the Listen KeepAlive option for an explanation of the valid
     values.

Stderr ReuseAddr:                  (Default: 1)

     Sets the reuseaddr option for the standard error socket.  See
     the Listen ReuseAddr option for an explanation of the valid
     values.

Stderr Shutdown:                   (Default: 2)

     Sets the shutdown option for the standard error socket.  See
     the Listen Shutdown option for an explanation of the valid
     values.
     
     

WINSOCK RSHD/95 SECURITY FILE

With Unix, security is enforced on remote command execution using a
combination of the password file (/etc/passwd), the hosts file
(/etc/hosts),and the host equivalency files (/etc/hosts.equiv and
$HOME/.rhosts).

Winsock RSHD/95 enforces security through the Security File.  The
name of this file is specified in the Winsock RSHD/95 Configuration
in the Security File entry.

If you specify a Security File name and the file does not exist or
the file is completely empty, all hosts and users are denied access.

Conversely, if you do not specify a Security File, all hosts and
users are granted access.  So if you do not wish to enforce any
security, do not specify a Security File name in the configuration
file.

Additionally, you can configure Winsock RSHD/95 to ensure that user
names on remote hosts are valid on this system.  You should only
enable this security option if you use consistent user names across
all of the systems on your network.

You create the Security File using a text editor.  If you are using
the Winsock RSHD/95 Control Panel applet, you can click on the Edit
Security button to run the Windows Notepad editor to edit the
security file specified in the Security File configuration option.

The Security File consists of lines that specify who may or may not
access the PC using Winsock RSHD/95.  The following are the options
available in:

   #
      Any line beginning with # is treated as a comment and is
     ignored.

   +
     A plus sign (+) on a line by itself specifies that ALL hosts
     and users are granted permission.  This is useful if you wish
     to allow many hosts and users, but deny only a few.  Use the
     deny options on subsequent lines.

   host

     You can specify a host that is granted permission by entering
     the name of the host on a line by itself.  All users on that
     host are granted permission, unless you specifically deny those
     users on subsequent lines.
     
     You may also use the IP address of the host instead (the dotted-
     decimal representation).  If you specify the name of the host,
     that name must appear in the hosts file used by your TCP/IP
     package.

   !host

     You can specify a host that is denied permission by entering an
     exclamation point (!) followed by the name of the host name of
     the host on a line.  All users on that host are denied
     permission, regardless of subsequent lines.

     You may also use the IP address of the host instead (the dotted-
     decimal representation).  If you specify the name of the host,
     that name must appear in the hosts file used by your TCP/IP
     package.

   +user
     
     You can specify a user name that is granted permission by
     entering a plus sign (+) followed by the user name on a line.
     Do not put any spaces between the plus sign and the user name.
     That user will be granted permission regardless of the host (as
     long as the host is not specifically denied).

     See below for an explanation of the source of the user name and
     how it is validated.

   -user

     You can specify a user name that is to be denied permission by
     entering a minus sign (-) followed by the user name on a line.
     Do not put any spaces between the plus sign and the user name.
     That user will be denied permission on all hosts.

      See below for an explanation of the source of the user name
     and how it is validated.

  +user@host

     You can specify a user name and a host that is granted
     permission by entering a plus sign (+) followed by the user
     name, an at-sign (@), followed by the host name on a line.  Do
     not put any spaces between the plus sign and the user name or
     before or after the at-sign.  That user on the specified host
     will be granted permission, but only from that host.

     You may also use the IP address of the host instead (the dotted-
     decimal representation).  If you specify the name of the host,
     that name must appear in the hosts file used by your TCP/IP
     package.

  -user@host

     You can specify a user name and a host that is denied
     permission by entering a minus sign (-) followed by the user
     name, an at-sign (@), followed by the host name on a line.  Do
     not put any spaces between the minus sign and the user name or
     before or after the
     
     at-sign.  That user on the specified host will be denied
     permission, but only when coming from that host.

     You may also use the IP address of the host instead (the dotted-
     decimal representation).  If you specify the name of the host,
     that name must appear in the hosts on the Windows 95 system.


If the request is coming from a Unix system, the user name is the
login name of the user.  If the request is coming from another
Windows PC, the method of specifying the user name is determined by
the implementation of the rsh or rcp command you are using.

Note that the standard Unix rsh command (and the Winsock RSH command
available from Denicomp Systems) allows a "-l" option to specify an
alternate user name.  The "-l" option has meaning on a Unix system,
but is not especially useful with Winsock RSHD/95.  However, if you
do use the "-l" option to specify an alternate user, as with Unix,
that user must be granted permission through the Security File in
addition to the login name (Unix) or the name specified in your
particular TCP/IP implementation (Windows/DOS).


USING THE SECURITY FILE

To effectively use the Security File, you must first understand how
it is viewed by Winsock RSHD/95.

When Winsock RSHD/95 receives a request, it sequentially processes
the lines in the Security File to determine whether or not the host
and user are granted or denied access.  It looks at each line in the
Security File until it determines that either the host or the user
is specifically denied permission.

Winsock RSHD/95 begins by assuming that permission is denied for the
request.  It then examines the lines in the Security File to see if
any of the lines pertain to this request.

Once Winsock RSHD/95 finds a line that denies access to either the
user or the host, it stops looking and denies permission.

If it finds a line that grants permission to the user and/or host,
permission is tentatively granted, but it continues to process the
lines in the Security File.

If it processes the entire Security File and does not find a line
that grants permission to the user and/or the host, permission is
denied.   If security was tentatively granted at some point and not
denied subsequently, permission is granted.



For example, let's say that the following is the contents of the
Security File:

      jetty
      booey
      eib
      192.56.42.3
      rs6000
      +fred@mars
      -gary@booey
      -jackie
      +robin

In this example, if any user on the host "jetty" makes a request,
permission will be granted, unless the user is "jackie", since
"jackie" is denied access from all hosts (-jackie).

If "jackie@jetty" makes a request, Winsock RSHD/95 reads through the
Security File and finds the host name "jetty", and tentatively
grants permission.  However, it continues and finds that the user
"jackie" is denied from all hosts, so permission is denied.

Also, if any user on the host "booey" makes a request, they are
granted permission unless the user is "gary", since "gary@booey" is
specifically denied permission (-gary@booey).  All other users on
the host "booey" are granted permission except "jackie" (-jackie).

The user "fred" on the host "mars" is granted permission because of
the line "+fred@mars".  However, since the host "mars" does not
appear on a line by itself, no other users on the host "mars" are
granted permission except the user "robin", who is granted
permission from any host (+robin).


EXECUTING COMMANDS

With Unix, the rsh utility executes the specified command on a
remote host and returns the standard output and the standard error
output to the requesting host.

With Windows, there is no such thing as "standard output" and
"standard error".  Programs execute in graphical windows, so there
is no way to return any output using rsh.

Therefore, when using rsh from Unix or another PC to initiate
commands on a Windows PC, you will not see any output of the command
on your screen.  It will display on the PC that received the
request.

For example, if you used the following command:

          rsh winpc3 excel

This would start Excel on the PC named "winpc3".  You would see
nothing on your screen as a result of starting Excel.  Excel would
be running on the screen of the PC named "winpc3".

The rsh command will NOT wait for the specified command to complete.
The system issuing the request will regain control immediately after
the command begins.

If you attempt to execute a command that does not exist or Windows
returns an error trying to load the program, you will receive a
descriptive error message on your screen from Winsock RSHD/95 to
tell you that the command was not successfully executed.


SENDING KEYSTROKES

Winsock RSHD/95 provides the ability for you to send keystrokes to
the Windows application you initiate using the rsh command.  It also
allows you to specify how the window is to be displayed (i.e.,
normal, minimized, maximized, or hidden).  This provides you with
some "remote control" over what the program you run does once it
starts.

For those of you who program in Microsoft Visual Basic or the Visual
Basic for Applications macro language, this is very similar to the
SendKeys capability of those programming languages.

The standard syntax of the rsh command is:

             rsh hostname command

This will execute "command" on the host "hostname".  Winsock RSHD/95
allows a slight modification of the rsh syntax to send keystrokes.
This is compatible with all rsh commands.  The alternative syntax
for sending keystrokes is:

             rsh hostname "<keystrokes>" command

If the first parameter after the host name begins with a less-than
sign (<), that parameter is interpreted as keystrokes to be sent to
the command specified in the next parameter.  The keystrokes must
end with a greater-than sign (>).  You must also enclose the entire
parameter in quotes so special characters and spaces are not
interpreted by the operating system.

For example, if you wanted to run the Windows Notepad on the PC
named "winpc3" and type "This is a test" on the first line, the
command would be:

             rsh winpc3 "<This is a test>" notepad

If you looked at the winpc3's screen, you would see the Windows
Notepad with "This is a test" on the first line.

You cannot send keystrokes to an application that is not designed to
run in Microsoft Windows (i.e., MS-DOS programs).

Important Note:  Due to a limitation in Windows 95, you cannot send
keystrokes to an application started through Winsock RSHD/95 if
there is no one logged in to Windows 95.  The program will be
executed, but it will not receive the keystrokes.


SENDING SPECIAL KEYSTROKES

Winsock RSHD/95 also allows you to specify special keys in the
keystrokes parameter that cannot normally be typed on a command
line, such as embedded Enter keys, function keys, ALT keys, etc.

Keystrokes are sent sequentially as the appear between the "<" and
">".  To send a single character, use the character itself.  For
example, to send the letter "X", use the letter "X".  To send the
word "hello", just specify those letters.

To specify keys combined with any combination of Shift, Ctrl, and
Alt keys, prefix the regular key code to one or more of the
following codes:

          Shift     +
          Control   ^
          Alt       %

For example, to send the Alt-F keystroke, specify "%F".  To send
Ctrl-Alt-D, specify "^%D".

To send the Enter key, use the tilde (~).

To specify that the Shift, Ctrl, and/or Alt keys should be held down
while several other keys are pressed, enclose the key codes in
parentheses ( ).  For example, to have the Alt key held down while X
and D are pressed, use "%(XD)".  You could also use "%X%D", but if
the Shift, Ctrl, and/or Alt keys need to be held down for a number
of keystrokes, the parentheses can make the string shorter.  Also,
you would want to use the parentheses if the application
detects the release of the Shift, Ctrl, and/or Alt keys and that is
not desired.

The following characters have special meaning in the keystroke
parameter, so they must be enclosed inside braces ({ }).  Some of
these special characters have not been explained yet.

            Special Character          Example

          +  (plus)      {+}
          ^  (caret)          {^}
          %  (percent)        {%}
          ~  (tilde)          {~}
          <  (less than)      {<}
          >  (greater than)   {>}
          [  (left sq. bracket)    {[}
          ]  (right sq. bracket)   {]}
          (  (left paren)          {(}
          )  (right paren)         {)}
          @  (at-sign)        {@}
          {  (left brace)          {{}
          }  (right brace)         {}}



To send characters that are not normally displayed when you press a
key (such as Enter or Tab) and keys that represent actions rather
than characters, use the following special codes:

       Key                   Code                          Key
Code

     Backspace {BACKSPACE} or {BS} Break          {BREAK}
     Caps Lock {CAPSLOCK}                    Clear          {CLEAR}
     Del       {DELETE} or {DEL}         Down Arrow    {DOWN}
     End       {END}                              Enter
{ENTER} or ~
     Esc       {ESCAPE} or {ESC}        Help      {HELP}
     Home      {HOME}                             Ins       {INSERT}
     Left Arrow     {LEFT}                             Num Lock
{NUMLOCK}
     Page Down {PGDN}                             Page Up   {PGUP}
     Print Screen   {PRTSC}                            Right Arrow
{RIGHT}
     Scroll Lock    {SCROLLLOCK}             Tab       {TAB}
     Up Arrow  {UP}                                    F1
{F1}
     F2        {F2}                                    F3
{F3}
     F4        {F4}                                    F5
{F5}
     F6        {F6}                                    F7
{F7}
     F8        {F8}                                    F9
{F9}
     F10       {F10}                                   F11
{F11}
     F12       {F12}                                   F13
{F13}
     F14       {F14}                                   F15
{F15}
     F16       {F16}

You can also specify that a key is to repeat itself a certain number
of times, without repeating the key itself in the string.  To repeat
a keystroke, use the format:

                    {keystroke number}

Where "keystroke" is the key to repeat, followed by a single space,
then the number of times to repeat the key.

For example, to press the down arrow key eight times, use "{DOWN
8}".

To type thirty *'s, use "{* 30}".




PAUSING WITHIN KEYSTROKES

Under some circumstances, it may be necessary to pause for a
specific time before sending keystrokes to allow a program operation
to complete.  This is usually necessary when a program ignores
keystrokes that have been queued while a lengthly operation takes
place.

Within the keystroke list, you can specify pauses by using the
special {PAUSE #} keystroke.

This is not actually a keystroke, in that it does not press any key,
but it can be included anywhere within the keystroke list.  It will
pause the specified number of seconds.

For example, the following keystroke list will press Alt-F, P, wait
10 seconds, then press Alt-F, X:

     <%FP{PAUSE 10}%FX>

You can specify multiple pauses in the keystroke list if necessary.


KEYSTROKE EXAMPLE

The following example, will start Microsoft Word, load a file, print
it, then exit.

    rsh winpc3 "<%FO\docs\invoice.doc~%FP~%FX>" word


The keystrokes are:

                 %F           - Alt-F  (Drops down the file menu)
                  O           - O      (Selects Open)
  \docs\invoice.doc - Types the filename.
                 ~  - Enter  (Loads the File)
                 %F           - Alt-F  (Drops down the file menu)
                  P           - P      (Selects Print)
                  ~           - Enter  (Accepts the defaults on the
Print dialog box)
                 %F           - Alt-F  (Drops down the file menu)
                  X           - X      (Selects eXit and Word exits)


Note that if this example were being run from a Unix system, you
would have to use two backslashes (\\) for every one desired
backslash because the Unix shells interpret the backslashes as
special characters.  The command would then be:

           rsh winpc3 "<%FO\\docs\\invoice.doc~%FP~%FX>" word


KEYSTROKE MACRO FILES

If your keystroke strings get rather long or complex, you can store
them in a keystroke macro file so you do not have to specify all of
them each time you use the rsh command.

To create a keystroke macro file, you must use a text editor (or a
word processor, but be sure to save as an ASCII file).  Enter the
keystrokes as you would on the rsh command line, with the following
exceptions/reminders:

   - Do not enter "<" as the first character in the file or ">" as
     the last character.  All of the characters you enter in the
     file will be sent.

   - You may press Enter in the file to enter the keystrokes on
     multiple lines.  The line breaks have no effect on the
     keystrokes.  They will be treated as if they were entered all
     on the same line.  That is, you must remember to still use "~"
     or "{ENTER}" to "press" the Enter key.  Pressing Enter in the
     file will not send the Enter key.

   - You cannot nest keystroke macros.  Your macro file cannot
     contain references to other keystroke macro files.

   - The keystroke macro file must reside on the PC running Winsock
     RSHD/95. You can create the file on that PC or use rcp to copy
     it to that PC before executing the command.

To use a keystroke macro file, enter the at-sign (@) followed by the
filename in braces ({ }) where you would normally specify keystrokes
on the rsh command line.

You will most likely need to specify a full pathname of the
keystroke file on the PC running Winsock RSHD/95, unless you know
the working directory of Winsock RSHD/95 on the system running it
and the keystroke macro resides in that directory.  You may use
forward slashes (/) instead of backslashes if you wish; this makes
life easier for Unix users because the shell interprets the
backslash characters.

For example, if you had a macro in the directory \kbmac\printss.mac
on the PC running Winsock RSHD/95, you could use it with this
command:

      rsh winpc2 "<@{/kbmac/printss.mac}>" excel

This would run "excel" on winpc2 and send the keystrokes stored in
the file \kbmac\printss.mac to it.

You can intermix command line keystrokes and macro file keystrokes.
That is, you can specify some of the keystrokes on the command line
and use some from a macro file.   You can also use multiple macro
files.

For example, let's say we want to print a file using rsh through a
Windows application called "wintiff".  We want to store the
keystrokes in a macro file, but do not want to store the filename in
the macro file because it can change.

To do this you can store the first set of keystrokes in one macro
file, specify the filename on the rsh command line, then store the
remaining keystrokes in a second file.

For example, let's say the file is "mypic.tif":

rcp mypic.tif winpc2:/tmp
rsh winpc2 "<@{/kb/tif1.mac}\tmp\mypic.tif~@{/kb/tif2.mac}" wintiff

This example copies the file "mypic.tif" to the \tmp directory on
winpc2.  Then it runs "wintiff" and first sends the keystrokes from
the file \kb\tif1.mac.  That macro ends when "wintiff" requires a
filename.  The keystrokes to "type" the filename come from the rsh
command line since the tif1.mac has ended.  Then it continues by
sending the keystrokes in the file \kb\tif2.mac.  That is:

    @{/kb/tif1.mac}      -  Send keystrokes from \kb\tif1.mac
       \tmp\mypic.tif~   -  Type \tmp\mypic.tif and press Enter
    @{/kb/tif2.mac}      -  Send keystrokes from \kb\tif2.mac


SPECIFYING THE WINDOW TYPE

Winsock RSHD/95 also allows you to specify the window type of the
application being run.  Normally, the application is run using the
default window type specified in the RSHD/NT Control Panel applet
(the Default Window Type of Commands option).
"normally", as if you ran it by double-clicking on its icon
(assuming you did not set up the icon to run it minimized).

If you want to specify a different method of displaying the
application's window, you can specify this inside the keystroke
parameter by enclosing the method in square brackets ([ ]).

There are two methods of setting the window type.  You can use one
of the words shown below or you can use a number.  The options are:

     Window Option                  Displays

      NORMAL or NORM     Normal Display as defined by the application
      MINIMIZE or MIN    Shows the application as a minimized icon without focus
      MINACTIVE or MINA  Shows the application as a minimized icon with focus
      MAXIMIZE or MAX    Maximizes the application on startup
      HIDE               Hides the application (no icon appears)
      0                  Same as HIDE
      1                  Same as NORMAL
      7                  Same as MINIMIZE
      2                  Same as MINACTIVE
      3                  Same as MAXIMIZE

Other numeric values may be used - they correspond to the Windows'
ShowWindow function (for all you programmers).

For example, if you want to run the Windows Notepad maximized,
viewing the file "heyyou.txt", you would type:

    rsh winpc3 "<[MAXIMIZE]>%FOheyyou.txt~" notepad

This runs the Notepad maximized, then "presses" Alt-F-O (File Open)
and types the filename "heyyou.txt" and presses Enter to load it.

If you wanted to run some application that does some task and exits,
you could run it minimized using:

    rsh winpc3 "<[MINIMIZE]>" bkgprint

Note that Windows does not allow you to send keystrokes to a
minimized or hidden application.  Therefore, "[MINIMIZE]", "[HIDE]",
"[0]", or "[2]" should always appear alone between the "<" and ">".
If you specify other keystrokes, the application will not receive
them (Windows will beep at you for each keystroke).


WAITING FOR COMMANDS TO COMPLETE

By default, Winsock RSHD/95 returns control back to the system
issuing the command via rsh immediately after the command is started
and any keystrokes are sent.  It does not wait for the command to
complete.


If you want the rsh command to wait until the command finishes
executing, you can use the "[WAIT]" option.  This is specified like
the Window Type, as explained in the previous section.

For example, to execute the command "bkgprint" and wait for it to
finish, use:

     rsh winpc3 "<[WAIT]>" bkgprint

As with the Window Type, you can combine options and keystrokes.
This runs the above command, but minimizes it and waits:

     rsh winpc3 "<[MINIMIZE][WAIT]>" bkgprint

Note that Winsock RSHD/95 cannot process other command requests when
you instruct it to wait for a command to complete.  If other users
issue commands to the PC while it is waiting, they will be queued
until Winsock RSHD/95 can process them.  The number of requests that
can be queued depends on the Listen Backlog parameter explained in
the Winsock RSHD/95 Configuration section.


CAPTURING STANDARD OUTPUT AND STANDARD ERROR

You can optionally capture the standard output and standard error
output of Windows 95 Console or MS-DOS commands through Winsock
RSHD/95 with the rsh command.  This allows you to display the output
of these programs that output to the standard output or standard
error on another screen or capture it to a file on another system.

To do this, you must tell Winsock RSHD/95 that you are executing a
Console or MS-DOS command.  Winsock RSHD/95 cannot tell whether the
command you issue is a Windows program or a Console/MS-DOS program
until it starts executing it (and by then, it's too late!).

To capture the standard output/standard error of a command, use the
"[CON]" option in the rsh command.  For example:

    rsh winpc3 "<[CON]>" net view

This will run the "net view" command on "winpc3" and display the
output on the your screen.  The "net view" command displays
information on the standard output.  Note that if your command
requires any command line switches, place a space between the
command name and the switch.  For example, use "mem /c", not
"mem/c".

Note:  There is a configuration option that tells Winsock RSHD/95 to
assume the "<[CON]>" option on every command and capture the
standard output and standard error.  If this option is enabled, you
do not need to specify the "<[CON]>" option.

If you are on a Unix system and you want to store the output of the
"net view" command in a file, you can use the following command:

    rsh winpc3 "<[CON]>" net view > net.out

In this example, the file "net.out" will be created on the Unix
system, the system where the rsh command originated.  The ">
net.out" part of the command is not passed to "winpc3" because the
Unix shell interprets it first.

If you are using a Windows system and you want to do the same thing,
you must refer to the instructions for the implementation of the rsh
command you are using.  Windows does not support redirection, but MS-
DOS does.  If your rsh command is MS-DOS based, the above
command may work from a DOS prompt.  If you are using Denicomp
Systemss Winsock RSH, you could do the above within Windows with
the following command:


    rsh winpc -r net.out "<[CON]>" net view

Note that some MS-DOS programs do not write to the standard output;
instead they directly write to video memory.  Output from these
programs cannot be captured.

Also note that the output of the command is not returned in "real
time" as it is output from the program.  All output is stored in a
file on the PC running Winsock RSHD/95, then is sent over the
network when the program finishes.  So programs that display
"progress reports" to the standard output will display their
messages all at once when run through Winsock RSHD/95.

When a program outputs to both the standard output and standard
error, first the standard output is sent over the network, then the
standard error.  The output may not be sent in the order that it
would normally display if it were actually running on the PC.

A good example of this is the Microsoft C/C++ compiler.  It outputs
its "banner" (copyright message) to the standard error and displays
progress reports and error messages to the standard output.
Therefore, if you run the C compiler with an rsh command, you will
actually see the banner last since the standard output is sent first
and the standard error is sent last.

You can reverse the order of the sending of the standard output and
standard error by using the "[CON2]" option.  The acts just like the
"[CON]" option, but sends the standard error first.

The "[CON]" and "[CON2]" options imply the "[WAIT]" option, so there
is no need to specify it also.  Winsock RSHD/95 must wait for the
command to complete to capture its output.

To maintain compatibility with the Windows 3.1 version of Winsock
RSHD/95, you may also use "[DOS]" or "[DOS2]" in place of "[CON]"
and "[CON2]".


DISABLING THE CAPTURE OF STANDARD OUTPUT AND STANDARD ERROR

There is a configuration option that tells Winsock RSHD/95 to assume
the "<[CON]>" option on every rsh command and attempt to capture the
standard output and standard error.  This is useful if you mostly
execute Windows 95 Console and MS-DOS programs.

Howver, this can cause problems when you need to execute a Windows
program.  If this option is enabled, you cannot send keystrokes to
the program and Winsock RSHD/95 will

automatically wait for the command to complete.  There is also some
additional overhead involved in running the program.

If you have enable this option to assume the "<[CON]>" option and
you need to run a Windows program and send keystrokes to it or you
do not want rsh to wait for it to complete, specif the "<[WIN]>"
option in the rsh command line.  This option overrides the assumed
"<[CON]>" option for the command.  For example:

          rsh winpc "<[WIN]%FP~%FX>" excel abc.xls

This will run the command "excel abc.xls" on winpc as a Windows
program and send the specified keystrokes to it, overriding the
assumed "<[CON]>" option.


COPYING FILES USING RCP

Winsock RSHD/95 also provides Remote Copy (RCP) Server capability.
This allows you to copy files to and from a PC running Winsock
RSHD/95 using the rcp command.

The rcp command is commonly found on Unix systems, Windows NT
systems, and in some TCP/IP packages for Windows and DOS.  If your
TCP/IP package does not provide the rcp command, you can use Winsock
RCP from Denicomp Systems (not included with RSHD/95).

The rcp command is described in more detail in your TCP/IP package
manual or with the manual that comes with Winsock RCP.  However,
here are a few examples of its use.

Important Note:  Unlike the standard Unix rcp command and Denicomp
Systems rcp command (found in the Winsock RCP/RSH package), the
Windows NT rcp command copies all files with ASCII conversion by
default.  Binary files must be copied using the -b option of NTs
rcp command.  If you do not use the -b option on binary files, the
contents of the file will be altered on the destination system.

To copy a file from the host named "srvpc" to your PC or Unix
system, use:

      rcp srvpc:yourfile myfile

The file "yourfile" is copied from the host named "srvpc" to the
file on your PC named "myfile".  The host "srvpc" could be running
either Windows and Winsock RSHD/95 or Unix.

To copy a file from your PC or Unix system to the PC named "srvpc",
use:

      rcp \lists\xmas.doc srvpc:\word\lists

The file \lists\xmas.doc is copied from your system to the file
xmas.doc in the directory \word\lists on the PC named "srvpc".

To send the entire directory tree from your PC or Unix system to
"srvpc", use:

      rcp -b -r \share srvpc:\

All of the files and subdirectories in the directory \share are
copied to the PC named "srvpc".  It will create a \share directory
in the root directory (\) of srvpc.

If the \share directory contained any subdirectories, they would be
created on the other PC and all the files in them would also be
copied.

To copy all of the files ending with ".xls" from "srvpc" to your PC,
use:

      rcp -b srvpc:\sheets\*.xls .

This copies all of the files ending with ".xls" in the directory
\sheets on "srvpc" to the current directory (.) on your PC.

You can use drive letters if necessary.  For example, to copy a file
from the A: drive on the "srvpc" to your PC:

      rcp srvpc:a:file.txt file.txt

This will copy "file.txt" from the A: drive on "srvpc" to the file
"file.txt" on your system.


NOTE: Winsock RSHD/95 allows you to use both slashes (/) and
backslashes (\) for directory separators.  It will adjust
appropriately.  This is especially important for Unix users, since
backslashes are interpreted by the shell and must be escaped by
using two backslashes for every one backslash.  Use slashes instead.



CONTROLLING WINSOCK RSHD/95

The Winsock RSHD/95 service can be controlled from the RSHD/95
Control Panel applet using the Service Control button.  This can be
used whether you have installed RSHD/95 as a service or as a program
on the Start menu.

The Service Control allows you to do the following:

Start the Winsock RSHD/95 Service

     This starts the Winsock RSHD/95 Service if it is not currently
     running.
     
Stop the Winsock RSHD/95 Service

     This stops the Winsock RSHD/95 Service if it is currently
     running.  It will unload from memory and requests by client
     PCs using rcp or rsh will not be serviced until it is started
     again.
     
Refresh the Winsock RSHD/95 Service

     This sends a signal to Winsock RSHD/95 to tell it to re-read
     the registry options and apply any changes when possible.  This
     is useful if you change RSHD/95 options with a registry editor
     such as REGEDIT instead of the RSHD/95 Control Panel applet.

Install the Winsock RSHD/95 Service
     
     This installs the Winsock RSHD/95 Service in Windows 95s list
     of services.  It does not install the files from the Winsock
     RSHD/95 diskette.  It only adds Winsock RSHD/95 to the list of
     services that Windows 95 can execute.
     
Remove the Winsock RSHD/95 Service
     
     This removes the Winsock RSHD/95 Service from Windows 95s list
     of services.  It does not delete any files.  It only removes it
     from the list of services.  Use the Install option to add it to
     the list again.
     

SUPPORT

Support is available via U.S. Mail and Compuserve/Internet.

Denicomp Systems
P.O. Box 731
Exton, PA  19341

Compuserve: 71612,2333
Internet:   71612.2333@compuserve.com

